﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
namespace Character.Jarily
{
    public class SKill : MonoBehaviour
    {
        public Attribute m_skillType;
        public Color32 m_color;
        private void Awake()
        {
        }
        private void OnGUI()
        {
            if (GUILayout.Button("Attack", GUILayout.Height(40.0f), GUILayout.Width(40.0f)))
            {
                RaycastHit2D point = Physics2D.Raycast(transform.position,Vector2.right);
                Debug.DrawLine(transform.position,Vector2.right*10.0f);
                Chain cha = point.collider.gameObject.GetComponent<Chain>();
                if(cha.m_meterial == Meterial.iron) ReusableCode.electricity(cha.m_point,cha.Ring);
            }
        }
#if UNITY_EDITOR
        public bool Draw;
        private void OnDrawGizmos()
        {
            Handles.color = m_color;
            if (Draw) Handles.DrawSolidDisc(transform.position,Vector3.forward,1.0f);
        }
#endif
    }
}
